# -*- coding: utf-8 -*-
#
# Copyright 2008 Mikael Schönenberg
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# pylint is a python source code analyzer that can be downloaded at
# http://www.logilab.org/project/name/pylint
PYLINT	= pylint

# py.test is part of pylib and can be downloaded at http://codespeak.net/
PYTEST	= ../py/py/bin/py.test

tests:	test/report test_integration/report

all:	tests pylint/report

clean:
	find . -name \*~ -exec rm {} \;
	find . -name \*.pyc -exec rm {} \;
	find pylint/ test/ test_integration/ -name report -exec rm {} \;
	test -d test/SomeAddon && rm -r test/SomeAddon || true

pylint/report: kopsimo.py pylint/rc
	PYTHONPATH=. $(PYLINT) --rcfile pylint/rc kopsimo.py | tee $@

test/report: kopsimo.py test/test_*.py
	PYTHONPATH=. $(PYTEST) -v --resultlog=$@ test/

test_integration/report: kopsimo.py test_integration/test_*.py
	PYTHONPATH=. $(PYTEST) -v --resultlog=$@ test_integration/
